import dayjs from 'dayjs'

export const shortcuts = [
    {
        text: '今天',
        value: () => {
            return [dayjs().startOf('day'), dayjs()]
        }
    },
    {
        text: '昨天',
        value: () => {
            return [dayjs().startOf('day').subtract(1, 'day'),
                dayjs().endOf('day').subtract(1, 'day')]
        }
    },
    {
        text: '上周',
        value: () => {
            const end = new Date()
            const start = new Date()
            start.setDate(start.getDate() - 7)
            return [start, end]
        },
    },
    {
        text: '上个月',
        value: () => {
            const end = new Date()
            const start = new Date()
            start.setMonth(start.getMonth() - 1)
            return [start, end]
        },
    },
    {
        text: '过去3个月',
        value: () => {
            const end = new Date()
            const start = new Date()
            start.setMonth(start.getMonth() - 3)
            return [start, end]
        },
    },
]
